3d rotated cube using javascript